package wikichat.android.intelimed;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ScrollView;
import android.widget.TextView;

public class WikiActivity extends Activity {
	
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.wikipage);
		
		DatabaseHelper db = new DatabaseHelper(WikiActivity.this);
		
		
		Element element = db.getElement(1);
		
		Button bt_back = (Button)findViewById(R.id.wikiBack);
		
//		TextView screen = (TextView)findViewById(R.id.wikiView);

    	
		TextView texto2 = new TextView(this);
		texto2.setText(element._content_text);
    	texto2.setTextSize(20);
    	
    	ScrollView caixa = new ScrollView(this); //criando frame para scroll
    	caixa.addView(texto2);
    	
    	setContentView(caixa);     
      

		bt_back.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				Intent changePage = new Intent(WikiActivity.this, WIKICHATActivity.class);
				startActivity(changePage);
			}
		});
		
	}

}
